home *** CD-ROM | disk | FTP | other *** search
- global gPrevSprite, gNextSprite, gInstructStep, gInstructTotal, gWizWindow, gInstructRect, gInstructionWindow, gInstructStart, gTextSprite, gPageList
-
- on startMovie
- initText()
- initButtons()
- setButtons()
- displayNewText()
- end
-
- on closeWindow
- tell the stage
- set gInstructRect to the rect of gInstructionWindow
- end tell
- set the text of member "PageInfo" to " "
- forget(window "Instructions")
- end
-
- on initText
- set gTextSprite to 1
- puppetSprite(gTextSprite, 1)
- end
-
- on makePageList
- set myOldDelimiter to the itemDelimiter
- set the itemDelimiter to "-"
- set mySection to item 1 of gInstructStart
- set the itemDelimiter to myOldDelimiter
- set myMemberName to gInstructStart
- set gPageList to []
- repeat while myMemberName contains mySection
- add(gPageList, myMemberName)
- set myMemberName to the name of member (the number of member myMemberName + 1)
- end repeat
- set gInstructTotal to count(gPageList)
- set gInstructStep to 1
- end
-
- on initButtons
- set gPrevSprite to 2
- set gNextSprite to 3
- puppetSprite(gPrevSprite, 1)
- puppetSprite(gNextSprite, 1)
- end
-
- on setButtons
- if gInstructTotal = 1 then
- set the member of sprite gPrevSprite to the number of member "PrevDim"
- set the member of sprite gNextSprite to the number of member "NextDim"
- else
- if gInstructStep = 1 then
- set the member of sprite gPrevSprite to the number of member "PrevDim"
- set the member of sprite gNextSprite to the number of member "NextNormal"
- else
- if gInstructStep = gInstructTotal then
- set the member of sprite gPrevSprite to the number of member "PrevNormal"
- set the member of sprite gNextSprite to the number of member "NextDim"
- else
- set the member of sprite gPrevSprite to the number of member "PrevNormal"
- set the member of sprite gNextSprite to the number of member "NextNormal"
- end if
- end if
- end if
- setPage()
- end
-
- on displayNewText
- makePageList()
- set the member of sprite gTextSprite to gInstructStart
- setButtons()
- end
-
- on setPage
- set the text of member "PageInfo" to "Page" && gInstructStep && "of" && gInstructTotal
- end
-
- on goNext
- set gInstructStep to gInstructStep + 1
- set the member of sprite gTextSprite to getAt(gPageList, gInstructStep)
- setButtons()
- end
-
- on goPrev
- set gInstructStep to gInstructStep - 1
- set the member of sprite gTextSprite to getAt(gPageList, gInstructStep)
- setButtons()
- end
-
- on doButtonHilite ActionHandler
- set myNormalButton to the castNum of sprite the clickOn
- set myHiliteButton to myNormalButton + 1
- set the castNum of sprite the clickOn to myHiliteButton
- updateStage()
- repeat while the stillDown
- if rollOver(the clickOn) then
- set the castNum of sprite the clickOn to myHiliteButton
- else
- set the castNum of sprite the clickOn to myNormalButton
- end if
- updateStage()
- end repeat
- set the castNum of sprite the clickOn to myNormalButton
- updateStage()
- if rollOver(the clickOn) then
- if not voidp(ActionHandler) then
- do(ActionHandler)
- end if
- end if
- end
-
- on updateWindow
- setButtons()
- if objectp(window gWizWindow) then
- tell window gWizWindow
- stuffInstructions()
- end tell
- else
- put "telling stage"
- tell the stage
- stuffInstructions()
- end tell
- end if
- end
-